package com.mtiiot.fstcpserver.fastdfs.core;

public class StructGroupStat extends StructBase
{
  protected static final int FIELD_INDEX_GROUP_NAME = 0;
  protected static final int FIELD_INDEX_TOTAL_MB = 1;
  protected static final int FIELD_INDEX_FREE_MB = 2;
  protected static final int FIELD_INDEX_TRUNK_FREE_MB = 3;
  protected static final int FIELD_INDEX_STORAGE_COUNT = 4;
  protected static final int FIELD_INDEX_STORAGE_PORT = 5;
  protected static final int FIELD_INDEX_STORAGE_HTTP_PORT = 6;
  protected static final int FIELD_INDEX_ACTIVE_COUNT = 7;
  protected static final int FIELD_INDEX_CURRENT_WRITE_SERVER = 8;
  protected static final int FIELD_INDEX_STORE_PATH_COUNT = 9;
  protected static final int FIELD_INDEX_SUBDIR_COUNT_PER_PATH = 10;
  protected static final int FIELD_INDEX_CURRENT_TRUNK_FILE_ID = 11;
  protected static int fieldsTotalSize;

  protected static FieldInfo[] fieldsArray = new FieldInfo[12];
  protected String groupName;
  protected long totalMB;
  protected long freeMB;
  protected long trunkFreeMB;
  protected int storageCount;
  protected int storagePort;
  protected int storageHttpPort;
  protected int activeCount;
  protected int currentWriteServer;
  protected int storePathCount;
  protected int subdirCountPerPath;
  protected int currentTrunkFileId;

  public String getGroupName()
  {
    return this.groupName;
  }

  public long getTotalMB()
  {
    return this.totalMB;
  }

  public long getFreeMB()
  {
    return this.freeMB;
  }

  public long getTrunkFreeMB()
  {
    return this.trunkFreeMB;
  }

  public int getStorageCount()
  {
    return this.storageCount;
  }

  public int getActiveCount()
  {
    return this.activeCount;
  }

  public int getStoragePort()
  {
    return this.storagePort;
  }

  public int getStorageHttpPort()
  {
    return this.storageHttpPort;
  }

  public int getCurrentWriteServer()
  {
    return this.currentWriteServer;
  }

  public int getStorePathCount()
  {
    return this.storePathCount;
  }

  public int getSubdirCountPerPath()
  {
    return this.subdirCountPerPath;
  }

  public int getCurrentTrunkFileId()
  {
    return this.currentTrunkFileId;
  }

  public void setFields(byte[] bs, int offset)
  {
    this.groupName = stringValue(bs, offset, fieldsArray[0]);
    this.totalMB = longValue(bs, offset, fieldsArray[1]);
    this.freeMB = longValue(bs, offset, fieldsArray[2]);
    this.trunkFreeMB = longValue(bs, offset, fieldsArray[3]);
    this.storageCount = intValue(bs, offset, fieldsArray[4]);
    this.storagePort = intValue(bs, offset, fieldsArray[5]);
    this.storageHttpPort = intValue(bs, offset, fieldsArray[6]);
    this.activeCount = intValue(bs, offset, fieldsArray[7]);
    this.currentWriteServer = intValue(bs, offset, fieldsArray[8]);
    this.storePathCount = intValue(bs, offset, fieldsArray[9]);
    this.subdirCountPerPath = intValue(bs, offset, fieldsArray[10]);
    this.currentTrunkFileId = intValue(bs, offset, fieldsArray[11]);
  }

  public static int getFieldsTotalSize()
  {
    return fieldsTotalSize;
  }

  static
  {
    int offset = 0;
    fieldsArray[0] = new FieldInfo("groupName", offset, 17);
    offset += 17;

    fieldsArray[1] = new FieldInfo("totalMB", offset, 8);
    offset += 8;

    fieldsArray[2] = new FieldInfo("freeMB", offset, 8);
    offset += 8;

    fieldsArray[3] = new FieldInfo("trunkFreeMB", offset, 8);
    offset += 8;

    fieldsArray[4] = new FieldInfo("storageCount", offset, 8);
    offset += 8;

    fieldsArray[5] = new FieldInfo("storagePort", offset, 8);
    offset += 8;

    fieldsArray[6] = new FieldInfo("storageHttpPort", offset, 8);
    offset += 8;

    fieldsArray[7] = new FieldInfo("activeCount", offset, 8);
    offset += 8;

    fieldsArray[8] = new FieldInfo("currentWriteServer", offset, 8);
    offset += 8;

    fieldsArray[9] = new FieldInfo("storePathCount", offset, 8);
    offset += 8;

    fieldsArray[10] = new FieldInfo("subdirCountPerPath", offset, 8);
    offset += 8;

    fieldsArray[11] = new FieldInfo("currentTrunkFileId", offset, 8);
    offset += 8;
  }
}